FROM kylin-server-v10-sp3-general-release-2206-loongarch64:b17

# Environment variables required for this build
ENV BCS_VERSION=3.1.0
ENV BCS_HOME /opt/bcs/BCS3.1.0
ENV TZ=Asia/Shanghai

# Basic support
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ>/etc/timezone


# Setup bcs
#WORKDIR $BCS_HOME
ADD BCS-3.1.0-KYLIN10-LOONGARCH-64.tar.gz $BCS_HOME
COPY bcs.config $BCS_HOME/conf/bcs.config
COPY docker-entrypoint.sh /usr/local/bin/

RUN mkdir -p "$BCS_HOME/data" && mkdir -p "$BCS_HOME/logs" \
    && ln -snf $BCS_HOME/bin/bes-cache-server /usr/local/bin/bes-cache-server \
    && ln -snf $BCS_HOME/bin/bes-cache-cli /usr/local/bin/bes-cache-cli \
    && chmod +x /usr/local/bin/docker-entrypoint.sh


EXPOSE 6080
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["bes-cache-server","/opt/bcs/BCS3.1.0/conf/bcs.config"]
